package com.dfbz.demo01_缓存字节流;

import java.io.FileInputStream;
import java.io.FileOutputStream;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo02_自定义字节数组拷贝 {
    public static void main(String[] args) throws Exception {
        long startTime = System.currentTimeMillis();

        FileInputStream fis = new FileInputStream("D:/apache-tomcat-8.0.43-feedback.zip");
        FileOutputStream fos = new FileOutputStream("D:/tomcat.zip");

        byte[] data = new byte[8192];
        int len;

        while ((len = fis.read(data)) != -1) {
            fos.write(data, 0, len);
        }

        fis.close();
        fos.close();

        long endTime = System.currentTimeMillis();

        System.out.println(endTime - startTime);
    }

}
